# -*- coding: utf-8 -*-

from odoo import models, fields


class BasicInfo(models.Model):
    _name = 'basic_info'
    _description = '个人基本信息表'

    phrId = fields.Char(string="健康档案号", required=True)
    middleId = fields.Char(string="中间表")
    cardNo = fields.Char(string="卡号")
    personName = fields.Char(string="姓名")
    sexCode = fields.Selection([
        ('1', '男'),
        ('2', '女'),
        ('3', '不男不女')],
        string="性别")
    idCard = fields.Char(string="证件号码")
    cardType = fields.Selection([
        ('1', '居民身份证'),
        ('2', '士官证'),
        ('3', '学生证'),
        ('4', '驾驶证'),
        ('5', '护照'),
        ('6', '港澳通行证')],
        string="证件类型")
    cardNum = fields.Char(string="证件编号")
    workPlace = fields.Char(string="工作单位")
    registeredPermanent = fields.Selection([
        ('1', '户籍'),
        ('2', '非户籍')],
        string="常住类型")
    nation = fields.Selection([
        ('1', '中国'),
        ('2', '外国')],
        string="国籍")
    rhBloodCode = fields.Selection([
        ('1', '阳性'),
        ('2', '阴性'),
        ('3', '不详')],
        string="RH阴性")
    educationCode = fields.Selection([
        ('1', '研究生'),
        ('2', '大学本科'),
        ('3', '大学专科和专科学校'),
        ('4', '中等专业学校'),
        ('5', '技工学校'),
        ('6', '高中'),
        ('7', '初中'),
        ('8', '小学'),
        ('9', '文盲或半文盲'),
        ('10', '不详')],
        string="文化程度")
    workCode = fields.Selection([
        ('1', '国家机关、党群组织、企业、事业单位负责人'),
        ('2', '专业技术人员'),
        ('3', '办事人员和有关人员'),
        ('4', '商业、服务业人员'),
        ('5', '农、林、牧、渔、水利业生产人员'),
        ('6', '生产、运输设备操作人员及有关人员'),
        ('7', '军人'),
        ('8', '不便分类的其它从业人员'),
        ('9', '无职业')],
        string="职业")
    maritalStatusCode = fields.Selection([
        ('1', '未婚'),
        ('2', '已婚'),
        ('3', '丧偶'),
        ('4', '离婚'),
        ('5', '未说明的婚姻状况')],
        string="婚姻状况")
    insuranceCode = fields.Selection([
        ('1', '城镇职工基本医疗保险'),
        ('2', '城镇(城乡)居民基本医疗保险'),
        ('3', '新型农村合作医疗'),
        ('4', '贫困救助'),
        ('5', '商业医疗保险'),
        ('6', '全公费'),
        ('7', '全自费')],
        string="支付方式")
    insuranceType = fields.Integer(string="其它的支付")
    masterFlag = fields.Boolean(string="是否户主")
    familyId = fields.Char(string="所属家庭")
    a_qt1 = fields.Char(string="其他过敏史")
    diseasetext_check_gm = fields.Selection([
        ('1', '无'),
        ('2', '青霉素'),
        ('3', '硫铵')],
        string="药物过敏史")
    diseasetext_check_fq = fields.Selection([
        ('1', '无'),
        ('2', '高血压'),
        ('3', '糖尿病'),
        ('4', '冠心病'),
        ('5', '慢性阻塞性肺疾病'),
        ('6', '恶性肿瘤'),
        ('7', '脑卒中'),
        ('8', '严重精神障碍'),
        ('9', '结核病'),
        ('10', '肝炎'),
        ('11', '先天畸形')],
        string="家族疾病史-父亲")
    diseasetextCheckMQ = fields.Selection([
        ('1', '无'),
        ('2', '高血压'),
        ('3', '糖尿病'),
        ('4', '冠心病'),
        ('5', '慢性阻塞性肺疾病'),
        ('6', '恶性肿瘤'),
        ('7', '脑卒中'),
        ('8', '严重精神障碍'),
        ('9', '结核病'),
        ('10', '肝炎'),
        ('11', '先天畸形')],
        string="家族疾病史-母亲")
    diseasetextCheckXDJM = fields.Selection([
        ('1', '无'),
        ('2', '高血压'),
        ('3', '糖尿病'),
        ('4', '冠心病'),
        ('5', '慢性阻塞性肺疾病'),
        ('6', '恶性肿瘤'),
        ('7', '脑卒中'),
        ('8', '严重精神障碍'),
        ('9', '结核病'),
        ('10', '肝炎'),
        ('11', '先天畸形')],
        string="家族疾病史-兄弟姐妹")
    diseasetextCheckZN = fields.Selection([
        ('1', '无'),
        ('2', '高血压'),
        ('3', '糖尿病'),
        ('4', '冠心病'),
        ('5', '慢性阻塞性肺疾病'),
        ('6', '恶性肿瘤'),
        ('7', '脑卒中'),
        ('8', '严重精神障碍'),
        ('9', '结核病'),
        ('10', '肝炎'),
        ('11', '先天畸形')],
        string="家族疾病史-子女")
    diseasetext_check_bl = fields.Selection([
        ('1', '无'),
        ('2', '化学品'),
        ('3', '毒物'),
        ('4', '射线')],
        string="暴露史")
    diseasetext_radio_jb = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="是否有疾病")
    diseasetext_zyb = fields.Char(string="职业病")
    diseasetext_qtfdcrb = fields.Char(string="其他法定传染病")
    diseasetext_qt = fields.Char(string="其他")
    confirmdate_gxy = fields.Date(string="确诊时间", default=fields.Date.today())
    diseasetext_check_jb = fields.Char(string="疾病")
    birthday = fields.Date(string="出生日期", default=fields.Date.today())
    contact = fields.Char(string="联系人姓名")
    contactPhone = fields.Char(string="联系人电话")
    bloodTypeCode = fields.Selection([
        ('1', 'A型'),
        ('2', 'B型'),
        ('3', 'O型'),
        ('4', 'AB型'),
        ('5', '不详')],
        string="血型")
    mobileNumber = fields.Char(string="本人电话")
    diseasetextYCBS = fields.Selection([
        ('1', '无'),
        ('2', '有')],
        string="遗传病史")
    genetic_his_desc = fields.Char(string="遗传病史描述")
    address = fields.Char(string="现住址")
    homePlace = fields.Char(string="户籍地址")
    isAgrRegister = fields.Selection([
        ('0', '否'),
        ('1', '是')],
        string="是否农业户籍")
    signFlag = fields.Char(string="签约标志")
    recordSource = fields.Integer(string="档案来源")
    incomeSource = fields.Char(string="经济来源")
    nationCode = fields.Integer(string="民族")
    familyAddress = fields.Char(string="家庭住址")
    householder_rel = fields.Integer(string="与户主关系")
    householder_rel_dscr = fields.Char(string="户主关系描述")
    email = fields.Char(string="电子邮箱")
    town_id = fields.Char(string="乡镇ID")
    town_name = fields.Char(string="乡镇名称")
    village_id = fields.Char(string="村庄ID")
    village_name = fields.Char(string="村庄名称")
    householder_id = fields.Char(string="户主ID")
    householder_name = fields.Char(string="户主姓名")
    householder_id_certnum = fields.Char(string="户主身份证号")
    fam_size = fields.Integer(string="家庭人口数")
    fam_struct = fields.Char(string="家庭结构")
    living_cond = fields.Integer(string="居住情况")
    signa = fields.Char(string="本人签字")
    fam_signa = fields.Char(string="家属签字")
    confirm_time = fields.Date(string="确认时间", default=fields.Date.today())
    createDate = fields.Date(string="建档日期", default=fields.Date.today())
    createUser = fields.Char(string="建档人")
    create_org = fields.Char(string="建档机构")
    division_id = fields.Char(string="所属区划")
    org_id = fields.Char(string="所属机构")
    update_time = fields.Date(string="更新时间", default=fields.Date.today())
    update_operator_id = fields.Char(string="更新操作人")
    is_delete = fields.Boolean(string='是否删除')
    mod_state = fields.Integer(string="修改状态")
    diseasetext_ss = fields.Integer(string="既往史手术")
    diseasetext_ws = fields.Integer(string="既往史外伤")
    diseasetext_sx = fields.Integer(string="既往史输血")
    shhjCheckCFPFSS = fields.Selection([
        ('1', '无'),
        ('2', '油烟机'),
        ('3', '换气扇'),
        ('4', '烟囱')],
        string="厨房排气设施")
    shhjCheckRLLX = fields.Selection([
        ('1', '液化气'),
        ('2', '煤'),
        ('3', '天然'),
        ('4', '沼气'),
        ('5', '柴火')],
        string="燃料类型")
    shhjCheckYS = fields.Selection([
        ('1', '自来水'),
        ('2', '经净化过滤的水'),
        ('3', '井水'),
        ('4', '河湖水'),
        ('5', '塘水')],
        string="饮水")
    shhjCheckCS = fields.Selection([
        ('1', '卫生厕所'),
        ('2', '一格或二格粪池式'),
        ('3', '马桶'),
        ('4', '露天粪坑'),
        ('5', '简易棚厕')],
        string="厕所")
    shhjCheckQCL = fields.Selection([
        ('1', '无'),
        ('2', '单设'),
        ('3', '室内'),
        ('4', '室外')],
        string="禽畜栏")
    auto_create = fields.Selection([
        ('0', '否'),
        ('1', '是')],
        string="是否是自动创建", default='0')
    is_death = fields.Selection([
        ('0', '否'),
        ('1', '是')],
        string="是否死亡", default='0')
    deadDate = fields.Date(string="死亡日期", default=fields.Date.today())
    deadReason = fields.Char(string="死亡原因")
    manaDoctorId = fields.Char(string="责任医生")
    spec_pop_class = fields.Selection([
        ('1', '失业下岗人员'),
        ('2', '边缘人群'),
        ('3', '革命伤残军人')],
        string="人群分类")
    datasource = fields.Integer(string="数据来源")
